load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
    name = "cloud_device",
    srcs = glob(
        [
            "standard_mqtt/wrapper/*.cc",
            "standard_mqtt/*.cc",
            "*.cc",
        ]
    ),
    hdrs = glob(
        [
            "standard_mqtt/wrapper/*.h",
            "standard_mqtt/*.h",
            "*.h",
        ]
    ),
    deps = [
        "@yaml_cpp//:yaml_cpp",
        "@com_github_google_glog//:glog",
        "@paho//:paho",
        "//base/device_connect/proto:cloud_data_cc_pb",
    ],
    linkopts = [
        "-pthread -lz -lrt -luuid",
    ],
    visibility = [
        "//visibility:public"
    ],
    linkstatic = False,
)

cc_test(
     name="cloud_ut",
     srcs = ["ut/cloud_test.cc"],
    linkopts = [
        "-pthread -lz"
    ],
     deps=[
        "@com_google_googletest//:gtest_main",
        ":cloud_device",
     ]
)